import { stringify } from 'qs';
import request from '../utils/request';

export async function tboxList(params) {
  return request(`/tbox/list?${stringify(params)}`, {
    method: 'GET',
  });
}
export async function tboxDelete(params) {
  return request(`/tbox/delete/${params}`, {
    method: 'delete',
  });
}
export async function tboxAdd(params) {
  return request('/tbox/add', {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function tboxEdit(params) {
  return request('/tbox/edit', {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function bindingSim(params) {
  return request('/tbox/bindingsim', {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
export async function bindingVin(params) {
  return request('/tbox/bindingvin', {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function fetchTboxById(params) {
  return request(`/tbox/findbyid/${params}`, {
    method: 'GET',
  });
}
